package com.yjd.comm.enums;

/**
 * 用户展示状态（包括订单状态和还款报表状态）
 * Created by yangchangyan on 2018/2/12.
 */
public enum OrderShowStatusEnum {

    // 还款报表状态
    RPT_UNKNOWN(10, "未知"), // 还款报表还没有生成
    RPT_NONE_CLEAN(11, "当期未还"),
    RPT_CLEAN(12, "当期已还"),
    RPT_ALL_CLEAN(13, "全部结清"),
    RPT_OVERDUE(14, "已逾期"),

    // 订单状态
    ODR_ACCEPT(20, "受理中"), // 还没有支付首付
    ODR_AUDITING(21, "审核中"),
    ODR_REPAYMENTING(22, "还款中"),
    ODR_REFUSE(23, "拒绝"), // 商户拒绝、资金方拒绝
    ODR_REPAYMENED(24, "订单完成"),
    ODR_CANCEL(25, "已取消")
    ;

    private int code;
    private String label;

    public static OrderShowStatusEnum parse(int code) {
        for (OrderShowStatusEnum v : OrderShowStatusEnum.values()) {
            if (v.getCode() == code) {
                return v;
            }
        }
        return null;
    }

    private OrderShowStatusEnum(int code, String label) {
        this.code = code;
        this.label = label;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
}
